class ListNode:
    def __init__(self,x):
        self.val=x
        self.next=None

head=ListNode(4)
head.next=ListNode(5)
head.next.next=ListNode(1)
head.next.next.next=ListNode(9)

def deleteNode(node):
    head=node
    node=head.next
    print(".......操作前的元素...........")
    kk=node
    is_h=False
    while node.next!=None and node!=None:
        #如果当前节点的下一个节点不是none，表示当前节点不是最后一个节点
        print(node.val)
        node.val=node.next.val
        node=node.next
        if is_h:
            kk=kk.next
        is_h=True
    kk.next=None
    print("................................")
    p1=head
    while p1!=None:
        print(p1.val)
        p1=p1.next

deleteNode(head)